class Solution:
    def multiply(self, num1: str, num2: str) -> str:
        s1, s2 = num1[::-1], num2[::-1]
        t = [0] * (len(num1) + len(num2))

        for i in range(len(s1)):
            for j in range(len(s2)):
                t[i + j] += int(s1[i]) * int(s2[j])
        i = 0
        c = 0
        res = ''
        i_e = 0
        for j in range(len(t) - 1, -1, -1):
            if t[j] != 0:
                i_e = j
                break
        while i <= i_e:
            c += t[i]
            res = str(c % 10) + res
            c = c // 10
            i += 1
        res = str(c) + res if c else res
        res = '0' if res == '' else res
        return res
